REPO_ROOT="/remote/iosg/home-8/bot-hft/jenkins/workspace/coin2_feed_stats/coin"
cd "${REPO_ROOT}"

if [ -n "${1}" ]; then
    START_DATE="${1}"
else
    START_DATE="$(TZ=UTC date '+%Y%m%d')"
fi

if [ -n "${2}" ]; then
    END_DATE="${2}"
else
    END_DATE=${START_DATE}
fi

source /remote/iosg/home/bot-hft/miniconda3/etc/profile.d/conda.sh
conda activate /remote/iosg/home/bot-hft/miniconda3/envs/coin2_motion_env_migration
cd python

./pyrunner coin/support/feed_tool/feed_stats/app/feed_stats_motion/feed_stats_cleaner.py \
--start_date="${START_DATE}" \
--end_date="${END_DATE}" \
--interval_feed_retention=${3}